package com.jsy.goods.feign;

import com.jsy.common.vo.Result;
import com.jsy.goods.pojo.Goods;
import com.jsy.goods.pojo.Spu;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("goods")
@RequestMapping("/spu/")
public interface SpuFeign {

    /***
     * 查看spu数据
     * @param spuId 查看对象
     * @return 操作结果
     */
    @GetMapping("/goods/{spuId}")
    Result<Goods> findGoodsBySpuId(@PathVariable Long spuId);

    /***
     * 根据ID查询Spu数据
     * @param id 主键
     * @return 查询结果
     */
    @GetMapping("/{id}")
    Result<Spu> findById(@PathVariable Long id);
}
